package com.dimples.dd.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dimples.dd.tenant.core.dataobject.TenantBaseDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户和角色关联表
 */
@Schema(description = "用户和角色关联表")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "system_user_role")
public class SystemUserRoleDO extends TenantBaseDO {
    /**
     * 自增编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "自增编号")
    private Long id;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    @Schema(description = "用户ID")
    private Long userId;

    /**
     * 角色ID
     */
    @TableField(value = "role_id")
    @Schema(description = "角色ID")
    private Long roleId;

    public SystemUserRoleDO(Long userId, Long roleId) {
        this.userId = userId;
        this.roleId = roleId;
    }

    public SystemUserRoleDO() {
    }
}